package com.zsrt.java.day20161226.zzd.demo4;

import java.util.Scanner;

public class DaoXu {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		System.out.println("请输入1个不大于5位的数字：");
  	    int number=sc.nextInt();
  	    sc.close();
  	    
		if(number/10000>=1){
			int gewei=number%10;
			int shiwei = number%100/10;
			int baiwei = number%1000/100;
			int qianwei = number%10000/1000;
			int wanwei = number/10000;
			System.out.println("输出5位数...");
			int s[]={wanwei,qianwei,baiwei,shiwei,gewei};
			for(int i=s.length-1;i>=0;i--){
				 System.out.print(s[i]);
		    }
		}else if(number/1000>=1){
			int gewei=number%10;
			int shiwei = number%100/10;
			int baiwei = number%1000/100;
			int qianwei = number/1000;
			System.out.println("输出4位数...");
			 int s[]={qianwei,baiwei,shiwei,gewei};
			 for(int i=s.length-1;i>=0;i--){
				 System.out.print(s[i]);
		    }
		}else if(number/100>=1){
			int gewei=number%10;
			int shiwei = number%100/10;
			int baiwei = number%1000/100;
			System.out.println("输出3位数...");
			 int s[]={baiwei,shiwei,gewei};
			 for(int i=s.length-1;i>=0;i--){
				 System.out.print(s[i]);
		    }
		}else if(number/10>=1){
			int gewei=number%10;
			int shiwei = number%100/10;
			System.out.println("输出2位数...");
			 int s[]={shiwei,gewei};
			 for(int i=s.length-1;i>=0;i--){
				 System.out.print(s[i]);
		    }
		}else{
			int gewei=number%10;
			System.out.println("输出1位数...");
			 int s[]={gewei};
			 for(int i=s.length-1;i>0;i--){
				 System.out.print(s[i]);
		    }
		}
	}
}
